package com.ruoyi.pay.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.pay.domain.WxpayConfig;
import com.ruoyi.pay.mapper.WxpayConfigMapper;
import com.ruoyi.pay.service.IWxpayConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 微信支付配置Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-03
 */
@Service
public class WxpayConfigServiceImpl extends ServiceImpl<WxpayConfigMapper, WxpayConfig> implements IWxpayConfigService {
    @Autowired
    private WxpayConfigMapper wxpayConfigMapper;

    /**
     * 查询微信支付配置
     *
     * @param id 微信支付配置主键
     * @return 微信支付配置
     */
    @Override
    public WxpayConfig selectWxpayConfigById(Long id) {
        return wxpayConfigMapper.selectWxpayConfigById(id);
    }

    /**
     * 查询微信支付配置列表
     *
     * @param wxpayConfig 微信支付配置
     * @return 微信支付配置
     */
    @Override
    public List<WxpayConfig> selectWxpayConfigList(WxpayConfig wxpayConfig) {
        return wxpayConfigMapper.selectWxpayConfigList(wxpayConfig);
    }

    /**
     * 新增微信支付配置
     *
     * @param wxpayConfig 微信支付配置
     * @return 结果
     */
    @Override
    public int insertWxpayConfig(WxpayConfig wxpayConfig) {
            return wxpayConfigMapper.insertWxpayConfig(wxpayConfig);
    }

    /**
     * 修改微信支付配置
     *
     * @param wxpayConfig 微信支付配置
     * @return 结果
     */
    @Override
    public int updateWxpayConfig(WxpayConfig wxpayConfig) {
        return wxpayConfigMapper.updateWxpayConfig(wxpayConfig);
    }

    /**
     * 批量删除微信支付配置
     *
     * @param ids 需要删除的微信支付配置主键
     * @return 结果
     */
    @Override
    public int deleteWxpayConfigByIds(Long[] ids) {
        return wxpayConfigMapper.deleteWxpayConfigByIds(ids);
    }

    /**
     * 删除微信支付配置信息
     *
     * @param id 微信支付配置主键
     * @return 结果
     */
    @Override
    public int deleteWxpayConfigById(Long id) {
        return wxpayConfigMapper.deleteWxpayConfigById(id);
    }
}

